home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
X_TREE.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
65 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME X_TREE .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$STACK 2048 ' a recursive function exists, need room
$STRING 4 ' lots'a strings in here too
$INCLUDE "DAS-NB01.INC" ' yup! need'em both
$INCLUDE "DAS-NB02.INC" '
COLOR 7, 0
CLS
? "┌──────────────────────────────────────────────────────────────────────────
? "│ fTREElist% ( Tree$(), Indent%, MaxCols%, Drive$ )
? "│ fTREEpath$ ( Tree$(), ItemNo% )
? "│ fTREEfind% ( Tree$(), Path$ )
? "├──────────────────────────────────────────────────────────────────────────
? "│ fTREElist% does for directories what fDIRlist% does for files! It creates
? "│ a working list of directories & sub-dirs that can be used in a menu to
? "│ to allow the user to select the path he/she wishes to work with.
? "│ fTREEpath$ returns the full drive:\path\ for a given item of Tree$()
? "│ fTREEfind% returns the item# for the matching Tree$() element
? "└──────────────────────────────────────────────────────────────────────────
Drive$ = "C" ' change this to match your disk
Indent% = 2 ' the number of cols indent each level
MaxCols% = 30 ' max column width for display items
CDir$ = fCurDir$( Drive$ ) ' or whatever you want
UBnd% = 10 ' this shouldn't be enough!
DO
REDIM Tree$(UBnd%)
LastDir% = fTREElist%( Tree$(), Indent%, MaxCols%, Drive$ )
IF LastDir% =< Ubnd% THEN EXIT LOOP
UBnd% = LastDir%
LOOP
Item% = fTREEfind%( Tree$(), CDir$ ) ' locate it's pos in Tree$()
FOR X% = 1 TO LastDir%
IF X% = Item% THEN COLOR 0, 7 ' ugly but it works!
PRINT MID$( Tree$(X%), 3 ) ' NOTE the MID$ printing
IF X% = Item% THEN COLOR 7, 0
IF ( X% MOD 10 ) = 0 THEN fAnyKey ' pause for the human
NEXT
Item% = MIN( 17, LastDir% ) ' pick a number if you will
PRINT USING "ITEM ##'s FULL PATH: "; Item%;
PRINT fTREEpath$( Tree$(), Item% )